﻿using STHPMS1.DAL.D_Core;
using STHPMS1.ICore.I_DAL.Repository;
using STHPMS1.ICore.I_Entity.Stmpms1;
using System.Data;
using ServiceStack.OrmLite;

namespace STHPMS1.DAL.D_Repository
{
    public class Dm_Origpv_RegRepository : DalBase, IDm_Origpv_RegRepository
    {
        public T GetOrigpvRegByMainSeg<T>(string mainSegId)
            where T:IDm_Origpv_Reg
        {
            string sql =string.Format("SELECT TOP 1 *  FROM Dm_Origpv_Reg WHERE Modelvalue like '%{0}%'",mainSegId);
            IDbConnection conn = Adapter.OpenDbConnection();

            return conn.Single<T>(sql);
        }

         
    }
}
